#     Xepec.ru - социальная сеть
#     Copyright (C) 2008  Fedorchenko Alexander
#
#     This program is free software: you can redistribute it and/or modify
#     it under the terms of the GNU Affero General Public License as
#     published by the Free Software Foundation, either version 3 of the
#     License, or (at your option) any later version.
#
#     This program is distributed in the hope that it will be useful,
#     but WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#     GNU Affero General Public License for more details.
#
#     You should have received a copy of the GNU Affero General Public License
#     along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
#     Autor: Fedorchenko Alexander
#     Mail: sos20@list.ru
#     Date: 17/01/2009
#
#
#use CGI::Cookie;
#%cookies = fetch CGI::Cookie;

require "$DOC_ROOT/core.pl";

&get_query;#инициализация GET переменных

$uname_get=$queryString{"autor"};


my $auth_id = do_check();
if(!$auth_id) {print "Location: $SITE_ADDR\n\n"};


if ($auth_id != FALSE)
{
	@uname_arr = uname_get($auth_id); # массив юсера который запрашивает инфу тоесть с его инфой информации
	$title = @uname_arr[1];
}
else
{
	$title = "ананимус";
}
if (defined($index_and_no_login) && $index_and_no_login == TRUE)
{
	$sh_menu = FALSE;
	$jabber = FALSE;
	$rozisk = FALSE;
}

print "Content-Type: text/html; charset=utf-8\n\n";
print qq{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru">
<head>
<title>XEPEC.ru :: $title</title>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="autor" content="Fedorchenko Alexander" />
	<meta name="Copyright" content="Fedorchenko Alexander" />
	<meta name="Keywords" content="Социальная сеть xepec xepec.ru ХЕРЕС херес друзья подруги знакомства" />
	
	
<link rel="stylesheet" type="text/css" href="/style/style.css" media="screen" title="style (screen)" />
<!--script type="text/javascript" src="/js/username.js"></script-->};

if (!defined($jabber) or $jabber != FALSE)
{
    print qq{
    <script type="text/javascript" src="$MESS_DIR/config.js"></script>
    <script type="text/javascript" src="$MESS_DIR/shared.js"></script>
    <script type="text/javascript" src="$MESS_DIR/browsercheck.js"></script>
    <script type="text/javascript" src="$MESS_DIR/sounds.js"></script>
    <script type="text/javascript" src="$MESS_DIR/statusLed.js"></script>

    <!-- JabberConnection -->
    <script type="text/javascript" src="$MESS_DIR/jsjac.js"></script>

    <!-- Debugger -->
    <script type="text/javascript" src="$MESS_DIR/Debugger.js"></script>

    <script type="text/javascript" src="$MESS_DIR/test_jwchat.js"></script>

    <script type="text/javascript" src="$MESS_DIR/roster.js"></script>};
}
print qq{
</head>
<body>
	<div id="preload"></div>
	<div id="header">};
$xepec_nic_cookie = $cookies{'xepec_nic'}->value;
print qq{
		<h1>$xepec_nic_cookie\<span>\@xepес.ru</span></h1>
		<big>xepec.ru</big>};
print qq{	</div>
	<div id="menu">};
		if(!defined($sh_menu) or $sh_menu != FALSE)
		{
			if(defined($menu))
				{print $menu;}
			else
			{
				print qq{
					  <ul>
					    <li><a href="/username/index.pl?uname=$auth_id\">username</a></li>
					    <li><a href="/groups/">Проекты</a></li>
					    <li><a href="/litera/index.php?autor=$auth_id\">Литература</a></li>
					    <li><a href="/video/index.pl?uname=$auth_id\">Кино</a></li>
					    <li><a id="now" href=\"/music/index.pl\">Музыка</a></li>
					    <li><a href="/picture/index.php?uname=$auth_id\">Искуство</a></li>
					    <li><a href="#">Соль</a></li>

					  </ul>}; 
			}
		}
print qq{	</div>
	<div id="main">
		<div id="container">
			<div id="subnav">};
				print $subnav;
print qq{		</div>
			<!--проебаные события группы итд-->
			<div id="extras">};
				print $extras;
				if (!defined($jabber) or $jabber != FALSE)
				{
					print qq{<iframe src="$MESS_DIR/roster.html" name="jwc_main" width="100%" height="100%" marginwidth="0" marginheight="0" scrolling="no">Сообшения работают только на браузерах с поддержкой фрэймов</iframe>};
				}
print qq{		</div>		
			<div id="content" ><!-- контент -->
				<table border="0" width="100%">
					<tr>
						<td>};
						print $content;
print qq{					</td>
					</tr>};
				#if (!defined($rozisk) or $rozisk != FALSE){require "rozisk.pl"};
print qq{			</table>
				<div id="footer">
					v 0.1-rc1
				</div>
			</div><!--content-->
		</div><!--container-->
	</div><!--main-->
</body>
</html>};
